package com.hxkcloud.patient.adapter;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.TextView;

import com.hxkcloud.patient.R;
import com.hxkcloud.patient.beans.resultbeans.HospitalClassifyBean;
import com.hxkcloud.patient.views.SuperGridView;

import java.util.List;

/**
 * Created by Administrator on 2016/12/27.
 */

public class HospitalClassifyAdapter extends SuperGridView.Adapter {
    private Context context;
    private List<HospitalClassifyBean> list;

    public HospitalClassifyAdapter(Context context, List<HospitalClassifyBean> list) {
        this.context = context;
        this.list = list;
    }

    @Override
    public View getView(int position) {
        View view = LayoutInflater.from(context).inflate(R.layout.classify_item_view, null);
        TextView text_classify_name = (TextView) view.findViewById(R.id.text_classify_name);
        text_classify_name.setText(getItem(position).getClassifyName());
        return view;
    }


    @Override
    public int getCount() {
        return list.size();
    }

    @Override
    public HospitalClassifyBean getItem(int position) {
        return list.get(position);
    }

    @Override
    public long getItemId(int position) {
        return position;
    }
}
